import axios from 'axios'

axios.defaults.baseURL = 'http://127.0.0.1:80'
axios.defaults.timeout = 5000

export function loginByUsername ({username, password, project}) {
  const data = {
    username,
    password
  }
  return axios.post('/login', data)
}
export function getUserInfo (token) {
  return axios.post('/userinfo', token)
}
export function logout (username) {
  return axios.post('/logout', username)
}
